package LuoGu.排序.选举学生会;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int [] ans = new int [s.nextInt()+1];
        int n = s.nextInt();
        for(int i=0;i<n;i++){
            ans[s.nextInt()]++;
        }
        StringBuffer st = new StringBuffer();
        for(int i=0;i<ans.length;i++){
            while(ans[i]>0){
                st.append(String.valueOf(i)+" ");
                ans[i]--;
            }
        }
        System.out.print(st);
    }
}
